package com.cn.ryc.mapper;

import com.cn.ryc.model.Video;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

@Mapper
public interface VideoMapper {

    @Insert("INSERT INTO video_records (url, original_name, file_size, upload_time, user_id) " +
            "VALUES (#{url}, #{originalName}, #{fileSize}, #{uploadTime}, #{userId})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insertVideo(Video video);
}